package sliver.action.shop;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import sliver.service.ShopManager;

import com.opensymphony.xwork2.ActionSupport;

@Scope("prototype")
@Controller("shop.deleteGoodsAction")
public class DeleteGoodsAction extends ActionSupport{

	private static final long serialVersionUID = 6088146562462457759L;
	
	private Integer goodsId;
	
	@Autowired
	private ShopManager shopManager;
	
	public DeleteGoodsAction(){
		
	}

	public Integer getGoodsId() {
		return goodsId;
	}

	public void setGoodsId(Integer goodsId) {
		this.goodsId = goodsId;
	}
	
	@Override
	public String execute() throws Exception {
		
		shopManager.removeGoods(goodsId);
		
		return SUCCESS;
	}
}
